import React, { Component, useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';

function My() {
    // let navigate=useNavigate()
    // let location=useLocation()
    // console.log(location.pathname)
    // useEffect(()=>{
    //     let token =localStorage.getItem('token')
    // if(!token&&location.pathname=='/my'){
    //     console.log(11)
    //     navigate('/')
    // }
    // },[])
    
        return (
            <div>
                my
                <button onClick={()=> navigate('/')}>aa</button>
            </div>
        );
    
}

export default My;